<? 

include ("../../core.php5/Security/User.class.php"); #this line has to be the first one because of the session_start();
include("../../core.php5/DB/ORM.class.php");
include("../../core.php5/Grid.class.php");
include("../../core.php5/DB/DataBase.class.php");
include("../../core.php5/GridSource.class.php");
include("../../core.php5/GridPresenter.class.php");
include("../../core.php5/GUI/HtmlLink.class.php");
include("../../core.php5/GUI/ComboBox.class.php");
include("../../core.php5/GridLinker.class.php");
include "../../core.php5/GridSorter.class.php";
include "../../core.php5/GridSortPage.class.php";
include("../../core.php5/Utilities/Application.class.php");

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
	<div id="">
			<h3>Elimina Noticia</h3>
			
			<?php 
			
			USER::VerifySecurity();
			
			$usr=$_SESSION['user'];
			$q="DELETE FROM news WHERE idnews=".$_GET['id'];
						
			$res = DataBase::ExecuteNonQuery($q);
			if($res)
				echo '<div style="background-color:green;text-align:center;text-color:white"><b>Eliminado correctamente</b></div> <script>get("select/noticias.php","content");</script>';
			else
				echo '<div style="background-color:red;text-align:center">Error al Guardar</div>';
			
			?>
			

	</div>
</body>
</html>